<include file="Public/header"/>
<include file="Public/menu"/>
<style type="text/css">
.edit-batch-list .ebatch-name{
	width:480px;
}
</style>
<!-- 内容页 -->
<div class="content-wrapper">
    <!-- 面包屑 -->
    <section class="content-header">
        <h1>
            营销
            <small>管理</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="{:U('DiscountCoupon/index')}"><i class="fa fa-dashboard"></i> 营销</a></li>
            <li class="active">优惠券</li>
        </ol>
    </section>

    <!-- 内容 -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title">新增优惠券</h3>
                        <div class="box-tools">
                            <div class="btn-group pull-right" style="margin-right: 10px">
                                <a href="/admin/DiscountCoupon/index" class="btn btn-sm btn-default"><i class="fa fa-list"></i>&nbsp;优惠券列表</a>
                            </div>
                        </div>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form id="form" action="/admin/DiscountCoupon/add" method="post" accept-charset="UTF-8" class="form-horizontal" onSubmit="return checkSubmit();">
                        <div class="box-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">优惠卷名称</label>
                                <div class="col-sm-6">
                                    <div class="no-margin">
                                        <input name="name" value="" type="text" class="form-control" placeholder="优惠卷名称">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">优惠卷说明</label>
                                <div class="col-sm-6">
                                    <div class="no-margin">
                                        <textarea name="description" class="form-control"
                                                  placeholder="优惠卷说明"></textarea>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">排他功能</label>
                                <div class="col-sm-6">
                                    <div class="no-margin">
                                        否<input name="paita" value="0" type="radio" class="" checked>
                                        是 <input name="paita" value="1" type="radio" class="">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">排序</label>
                                <div class="col-sm-6">
                                    <div class="no-margin">
                                        <input name="sort" value="" class="form-control ajax-sort" type="text" placeholder="越小越靠前">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">优惠类型</label>
                                <div class="col-sm-6">
                                    <div class="no-margin">
                                        <select id="yh-type" name="type" class="form-control" onchange="showRelativeArea(this)">
                                            <option value="1" selected="selected">1：现金券</option>
                                            <option value="2">2：订单优惠券</option>
                                            <option value="3">3：商品优惠券</option>
                                        </select>
                                    </div>
                                </div>
                            </div>


                            <div class="form-group youhui_goods-area" style="display:block">
                                <label class="col-sm-2 control-label set_goods_name_values">设置排除商品</label>
                                <div class="col-sm-6">
                                    <div class="no-margin">
                                        <button type="button" class="btn btn-default pull-left" id="daterange-btn">
                                            <span>
                                              <i class="fa fa-calendar"></i>点击添加商品
                                            </span>
                                            <i class="fa fa-caret-down"></i>
                                        </button>                                        
                                    </div>
                                </div>
                            </div>
                             <div class="form-group youhui_goods-area" style="display:block">
                                <div class="col-sm-offset-2 col-sm-6">
                                    <div class="box box-primary" style="width:580px;">
                                        <!-- /.box-header -->
                                        <div class="box-body">
                                            <ul class="todo-list ui-sortable edit-batch-list">
                                            </ul>
                                        </div>                     
                                    </div>
                                </div>
                            </div>
                            <div class="form-group youhui_goods-area" style="display:block">
                                <label class="col-sm-2 control-label">&nbsp;&nbsp;</label>
                                <div class="col-sm-6">
                                    <div class="input-group">
                                        <input id="yc-goods-ids" name="goods_id_array" type="hidden"/>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group set-goods-area" style="display:none">
                                <label class="col-sm-2 control-label">优惠</label>
                                <div class="col-sm-6">
                                    <div class="input-group">
                                        <input id="goods_price" name="goods_price" class="form-control" />
                                        <span class="input-group-addon">元</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group money-price-area">
                                <label class="col-sm-2 control-label">现金优惠券</label>
                                <div class="col-sm-6">
                                    <div class="input-group">
                                        <input id="money_price" name="money_price" class="form-control" />
                                        <span class="input-group-addon">元</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group order-price-area" style="display:none">
                                <label class="col-sm-2 control-label">订单金额满</label>
                                <div class="col-sm-6">
                                    <div class="input-group">
                                        <input id="man_price" name="man_price" class="form-control" />
                                        <span class="input-group-addon">元</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group order-price-area" style="display: none">
                                <label class="col-sm-2 control-label">优惠</label>
                                <div class="col-sm-6">
                                    <div class="input-group">
                                        <input id="youhui_price" name="youhui_price" class="form-control"/>
                                        <span class="input-group-addon">元</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">开始时间</label>
                                <div class="col-sm-6">
                                	<div class="input-group">
                                    	<input class="form-control" type="text" id="start_time" name="start_time" value="" readonly />
                                    </div>
                                </div>                                
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">结束时间</label>
                                <div class="col-sm-6">
                                	<div class="input-group">
                                    	<input class="form-control" type="text" id="end_time" name="end_time" value="" readonly />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="box-footer">
                            <div class="col-sm-2"></div>
                            <div class="col-sm-6">
                                <div class="btn-group pull-right">
                                    <button type="submit" class="btn btn-info pull-right submit_click">提交</button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </section>
</div>
<!-- 底部 -->
<include file="Public/common_footer"/>
<script src="/Public/layer/layer.js"></script>
<link rel="stylesheet" href="/Public/admin/jedate/jedate.css" />
<script src="/Public/admin/jedate/jedate.js"></script>
<script type="text/javascript">
var yx_product_url = "{:U('DiscountCoupon/productAdd','' , '')}";
</script>
<script type="text/javascript" src="/Public/admin/js/admin.yx.discount.js"></script>
